package com.wxg.ch01.good;

import com.wxg.ch01.aop.Minstrel;
import com.wxg.ch01.bad.Knight;
import com.wxg.ch01.bad.QuestException;

public class BraveKnightV2 implements Knight {
    private Quest quest;
    private Minstrel minstrel;

    public BraveKnightV2(Quest quest, Minstrel minstrel) {
        this.quest = quest;
        this.minstrel = minstrel;
    }

    @Override
    public void embarkOnQuest() throws QuestException {
        minstrel.singBeforeQuest();
        quest.embark();
        minstrel.singAfterQuest();
    }
}
